
cd ""
global crisis "panic bank_failures bank_equity_crisis union2crisis crisisJST"

use "data/crisis.dta",clear
keep year iso_num iso country rgdppc cpi tloans lang bankeq30decline panic bank_failures bank_equity_crisis union2crisis crisisJST

**** merge score
merge 1:1 iso year using "data/f.dta"
drop if _merge == 2 //0
drop _merge

xtset iso_num year
qui gen rcredit_loan = tloans/cpi
qui gen credit_growth = (rcredit_loan - L.rcredit_loan) / L.rcredit_loan*100


qui gen Finance_sentiment_growth = all_stdscore - L.all_stdscore

eststo clear
foreach c in $crisis{
set seed 100
xtset iso_num year
eststo: xtlogit `c' L(1/2).Finance_sentiment_growth L(1/2).credit_growth if !inlist(country,"China","Russia"), fe vce(boot)

}

esttab using "output.csv", star(* 0.10 ** 0.05 *** 0.01) replace se stats(N r2 r2_w r2_a r2_p) 



	
